<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""DTD/xhtml1-strict.dtd">
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/c.tld" prefix="c"%>
<%@taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%>
<%@taglib uri="/WEB-INF/el.tld" prefix="el"%>
<%@taglib uri="/WEB-INF/fn.tld" prefix="fn"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<c:import url="/includes/css_inc.jsp"/>
		<c:import url="/includes/js_inc.jsp"/>
		<script>
			$(function(){
		        $("[name=search]").button({
		            icons: {
		                primary: "ui-icon-search"
		            }
		        });
			});
		</script>
	</head>
	<body>
		<c:import url="/apps/msg.jsp"/>
		<form class="acc67-form" name="serchForm" id="serchForm" action="${pageContext.request.contextPath}/acc6" method="post" onsubmit="return validateEmpty();">
		<input type="hidden" name="app" id="app" value="ACC60102"/>
		<input type="hidden" name="job" id="job" value="search"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="2"><b>${screenCode.ACC60102}</b></th>
			</tr>
			<tr>
				<td width="20%" class="bold">ปีงบประมาณ : </td>
				<td>
					<select name="budgetYear" id="budgetYear">
						<option value="" >----- เลือก -----</option>
						<c:if test="${!empty listBudgetYear}">
							<c:forEach var="data" items="${listBudgetYear}" varStatus="x">
								<c:if test="${data.BUDGET_YEAR == budgetYear}" var="selected"/>
								<option value="${data.BUDGET_YEAR}" ${selected?'selected':''} >${data.BUDGET_YEAR}</option>
							</c:forEach>
						</c:if>
					</select>
					<span id="$budgetYear" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td align="center" colspan="2">
					<button type="submit" name="search" class="acc67-button"> ค้นหาข้อมูล </button>
				</td>
			</tr>
		</table>
		<br/>
			<c:if test="${!empty listData}">
			<table width="100%" class="acc67-grid ui-widget ui-widget-content">
				<tr>
					<th align="center" class="ui-state-default">รหัส - ชื่อรหัสแจ้งจัดสรรเงินให้คู่สัญญา</th>
					<c:if test="${userInfo.roleId != '3' && userInfo.roleId != '6' && userInfo.roleId != '7' && userInfo.roleId != '8'}">
						<th align="center" class="ui-state-default" width="15%">SAP CODE</th>
					</c:if>
				</tr>
				<c:forEach var="data" items="${listData}" varStatus="x">
					<c:if test="${data.ALLOCATE_LEVEL == '1'}">
						<tr class="grid-tr-lvl1">
					</c:if>
					<c:if test="${data.ALLOCATE_LEVEL == '2'}">
						<tr class="grid-tr-lvl2">
					</c:if>
					<c:if test="${data.ALLOCATE_LEVEL == '3'}">
						<tr class="grid-tr-${x.count % 2}">
					</c:if>
						<c:if test="${data.ALLOCATE_LEVEL == '0'}">
							<td align="canter">${data.ALLOCATE_NAME}</td>
						</c:if>
						<c:if test="${data.ALLOCATE_LEVEL != 0}">
							<td align="canter">
								<c:forEach begin="1" end="${data.ALLOCATE_LEVEL}" step="1">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								</c:forEach>
								${data.ALLOCATE_CODE} - ${data.ALLOCATE_NAME}
							</td>
							<c:if test="${userInfo.roleId != '3' && userInfo.roleId != '6' && userInfo.roleId != '7' && userInfo.roleId != '8'}">
								<td>
									<c:if test="${data.ALLOCATE_LEVEL == '3'}">
										${data.SAP_CODE}
									</c:if>
								</td>
							</c:if>
						</c:if>
					</tr>
				</c:forEach>
			</c:if>
		</table>
		</form>
	</body>
</html>